package com.vastcom.cms.dao;

import com.vastcom.cms.model.News;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface NewsDao extends JpaRepository<News,String>{

    @Query("select n from News n order by n.pbdate desc ")
    Page<News>getNewsForPage(Pageable pageable);

    @Query("select n from News n where n.cate=:cate")
    Page<News>getNewsListByCate(@Param("cate")String cate,Pageable pageable);



}
